<template>
  <div class="u-p-20">
    <el-card shadow="never">
      <div slot="header">
        <span>
          <b class="u-f-16">用户提现申请列表</b>
        </span>
      </div>

      <el-form :inline="true" :model="queryForm" size="small" class="u-text-center">
        <el-form-item label="审核状态">
          <el-select v-model="queryForm.check" clearable>
            <el-option label="全部" value='-1'></el-option>
            <el-option label="同意" value="0"></el-option>
            <el-option label="待审核" value="1"></el-option>
            <el-option label="拒绝" value="2"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="关键词">
          <el-input v-model="queryForm.keyword" placeholder="输入关键词" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="getPageData(true)">查询</el-button>
        </el-form-item>
      </el-form>

      <el-table :data="tableData" class="u-mt-10" v-viewer>
        <el-table-column label="id" prop="id" width="100"></el-table-column>
        <el-table-column label="用户头像">
          <template slot-scope="scope">
            <el-image
              style="max-width:80px"
              :src="scope.row.head_img"
              :data-src="scope.row.head_img"
              fit="cover"
              lazy
            ></el-image>
          </template>
        </el-table-column>
        <el-table-column label="昵称" prop="nick_name"></el-table-column>
        <el-table-column label="电话号码" prop="phone"></el-table-column>
        <el-table-column label="提现金额" prop="price"></el-table-column>

        <el-table-column label="提现状态">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.check==0" type="success">同意</el-tag>
            <el-tag v-if="scope.row.check==1" type="warning">待审核</el-tag>
            <el-tag v-if="scope.row.check==2" type="danger">拒绝</el-tag>
          </template>
        </el-table-column>

        <el-table-column label="申请时间" prop="create_date"></el-table-column>

        <el-table-column label="操作" width="120">
          <template slot-scope="scope">
            <el-button
              @click.native="handleRoute(scope.row.id,'userExtractEdit')"
              v-if="hasPerm('userExtractEdit')"
              size="mini"
              type="text"
            >编辑/审核</el-button>
          </template>
        </el-table-column>
      </el-table>

      <div class="u-mt-20 u-text-center">
        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handlePageChange"
          :current-page="currentPage"
          :page-sizes="[10, 20, 30, 40, 50]"
          :page-size="limit"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        ></el-pagination>
      </div>
    </el-card>
  </div>
</template>

<script>
import commonPage from "@/mixins/common-page";
export default {
  mixins: [commonPage],
  data() {
    return {
      apiName: "user",
      apiPage: "userExtractPage",
      queryForm: {
        check: "-1",
        keyword: ""
      }
    };
  },
  methods: {}
};
</script>
